package com.xkp.news.dao;

import com.xkp.news.entity.User;
import com.xkp.news.util.FJdbc;
public class UserDaoImpl implements UserDao {
    @Override
    public User getUserByAcct(String acct) {
        return FJdbc.queryOne("select id,acct,name,pwd,crtime,uptime from sys_user where acct =?",User.class,new Object[]{acct});
    }
    @Override
    public boolean saveUser(User user) {
        Object[] params=new Object[]{user.getName(),user.getAcct(),user.getPwd(),user.getCrtime(),user.getUptime()};
        int x=FJdbc.update("insert into sys_user (name,acct,pwd,crtime,uptime) values (?,?,?,?,?)",params);
        return x>0;
    }
}
